package com.draem0507.refactor;

/**
 * @title what to do .
 * @desc
 * @atuh lwx
 * @createtime on 2015/11/14 17:21
 */
public class Day_29 {



    public class Consumer2
    {
        public AccountDataProvider AccountDataProvider ;

        public Consumer2(AccountDataProvider dataProvider)
        {
            AccountDataProvider = dataProvider;
        }

        public void Get(int id)
        {
            Account account = AccountDataProvider.GetAccount(id);
        }
    }



    public class Consumer {
        public AccountManager AccountManager;

        public Consumer(AccountManager accountManager) {
            AccountManager = accountManager;
        }

        public void Get(int id) {
            Account account = AccountManager.GetAccount(id);
        }
    }

    public class AccountManager {
        public AccountDataProvider DataProvider;

        public AccountManager(AccountDataProvider dataProvider) {
            DataProvider = dataProvider;
        }

        public Account GetAccount(int id) {
            return DataProvider.GetAccount(id);
        }
    }

    public class AccountDataProvider {
        public Account GetAccount(int id) {
            // get account
            return null;
        }
    }

    class Account {


    }

}
